﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Zen4SyncPOCO.POCO.Admin;
using System.Xml.Linq;

namespace Zen4SyncPOCO.ClientTestSessionDescriptorHandler
{
    internal class ClientTestSessionDescriptorHandler : IClientTestSessionDescriptorHandler
    {
        private ClientTestSessionDescriptorCreator creator;

        private ClientTestSessionDescriptorReader reader;

        internal ClientTestSessionDescriptorHandler()
        {
            creator = new ClientTestSessionDescriptorCreator();
            reader = new ClientTestSessionDescriptorReader();
        }

        public XElement CreateClientTestSessionDescriptor(ClientSession clientSession)
        {
            return creator.SerializeForClientTestSessionDescriptor(clientSession);
        }

        public ClientSession ReadClientTestSessionDescriptor(XElement clientTestSessionDescriptor)
        {
            return reader.UnserializeClientTestSessionDescriptor(clientTestSessionDescriptor);
        }
    }
}
